<?php
$hostname ="localhost";
$databasename ="qlshoppinghere";
$usernamelogindb = "root";
$password = "";
$sqlConnection;

function QuerySQL($StrSQL)
{
	global $sqlConnection, $hostname, $databasename, $usernamelogindb, $password;
	
	$sqlConnection = mysql_connect($hostname , $usernamelogindb , $password);
	mysql_select_db($databasename, $sqlConnection);
	mysql_query("SET NAMES 'utf8'");
	return mysql_query($StrSQL);
}

function InsertAndGetID($StrSQL)
{
	global $sqlConnection, $hostname, $databasename, $usernamelogindb, $password;
	
	$sqlConnection = mysql_connect($hostname , $usernamelogindb , $password);
	mysql_select_db($databasename, $sqlConnection);
	mysql_query("SET NAMES 'utf8'");
	mysql_query($StrSQL);
	return mysql_insert_id();
}

function StopConnection()
{
	global $sqlConnection;
	mysql_close($sqlConnection);
}

function Gotopage($file)
{
	$host = $_SERVER['HTTP_HOST'];
	$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
	header("Location: http://$host$uri/$file");
}

?>